package com.静态static;

public class Person {
    String name;
    static String country="大清";    //static 它是共享的 属于类，不属于对象，优先于对象产生
    String address;

    public Person(String name,String address){
        this.name=name;
        this.address=address;
    }

    public void eat(){
        this.name=name;
        System.out.println(name+"在吃");
    }

    public static void main(String[] args) {
        Person p1=new Person("张三","八大胡同");
        Person p2=new Person("李四","朝阳门");
        System.out.println(p1.country);
        Person.country="民国";         //最好是用类名去改，不要用对象去改
        System.out.println(p1.country);
        System.out.println(p2.country);
        p1.eat();
    }
}
